import {abstract_point} from "./abstract-point";
import {http} from "./http";

/**
 * 刷时间积分(+20)
 */
export class spoint extends abstract_point{

    /**
     *
     * @param user {user} 对象
     * @param time {Number} 执行次数
     * @param stime {Number} 时间(秒)
     */
    constructor(user,time=3,stime=10){
        super(user,time);
        this.stime=stime;
        this.nickName="刷计时的";
    }


    async request(){




        await http.get("/pss/service/postPoint?operateType=spoint" +
            "&userAccount=" + this.user.userAccount +
            "&domainCode=" + this.user.domainCode +
            "&timestamp=" + new Date().toString() +
            "&stime=" + this.stime +
            "&ssid=" +this.user.sid
        );



        await http.post(`/sss/service/coursewareService!commitStudy.do`,{
            domainCode: this.user.domainCode,
            userAccount: this.user.userAccount,
            stime: this.stime ,
            ssid: this.user.sid,
            type: 1,
            timestamp: new Date().toString()
        });
    }

}

